package com.ayou.plugin;

import lombok.SneakyThrows;

import java.lang.reflect.Method;

/**
 * @description: 代理对象所需参数
 * @author: ayouman
 * @date: 2024/11/11 23:22
 */
public class Invocation {
    private Method method;
    private Object target;

    private Object[] args;

    public Invocation(Method method, Object target, Object[] args) {
        this.method = method;
        this.target = target;
        this.args = args;
    }

    @SneakyThrows
    public Object proceed() {
        return method.invoke(target, args);
    }

    public Method getMethod() {
        return method;
    }

    public Object getTarget() {
        return target;
    }

    public Object[] getArgs() {
        return args;
    }
}
